/*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-10-12 17:22:44
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-10-13 11:20:08
 * @FilePath: /GateServer/src/validator/registervalidator.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma once
#include <memory>
#include <string>
#include "../redis/redismgr.h"
#include "../mysql/mysqlmgr.h"
#include "../entity/user.h"
#include "validator.h"
namespace Yizhi {

    class RegisterValidator:public Yizhi::Validator{
        public:
        RegisterValidator()=default;

      
        validateResult validate(const User &user) override;
        
        private:
        bool validPasswordMatch(const std::string &psw,const std::string &repsw);
        bool validateVarifycode(const std::string &email, std::string& code);
        bool checkUserExists(const std::string& username,const std::string &email);


     
    };
}